﻿using Common.Enum;
using DryWCS.Model.Enum;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DryWCS.Model.Stacker
{

    [SugarTable("Biz_StackerTask")]
    public class StackerTaskEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, IsNullable = false)]
        public int Id { get; set; }

        [SugarColumn(IsNullable = true)]
        public int WMSOrderId { get; set; }

        /// <summary>
        /// 1：复位，2：入库，3：出库，4：盘拣，5：移动，6：货位移动
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public int TaskType { get; set; }

        [SugarColumn(IsNullable = true,ColumnDescription ="托盘号")]
        public int TrayCode { get; set; }

        [SugarColumn(ColumnDescription = "起始设备号")]
        public int StartMachineID { get; set; } = 0;

        [SugarColumn(ColumnDescription = "起始排")]
        public int StartLineNo { get; set; }

        [SugarColumn(ColumnDescription = "起始层")]
        public int StartLayerNo { get; set; }

        [SugarColumn(ColumnDescription = "起始列")]
        public int StartColNo { get; set; }

        [SugarColumn(ColumnDescription = "终点设备号")]
        public int EndMachineID { get; set; }

        [SugarColumn(ColumnDescription = "终点排")]
        public int EndLineNo { get; set; }

        [SugarColumn(ColumnDescription = "终点层")]
        public int EndLayerNo { get; set; }

        [SugarColumn(ColumnDescription = "终点列")]
        public int EndColNo { get; set; }

        [SugarColumn(ColumnDescription = "是否锁定")]
        public bool IsLock { get; set; } = false;

        [SugarColumn(ColumnDescription = "是否有下个任务")]
        public bool HasNextTask { get; set; } = false;

        [SugarColumn(ColumnDescription = "下个任务id")]
        public int NextTaskId { get; set; } = 0;

        public TaskStatusEnum Status { get; set; } = TaskStatusEnum.未执行;

        public DateTime CreateTime { get; set; } = DateTime.Now;

        public DateTime StartTime { get; set; } = DateTime.Now;

        public DateTime EndTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "备注")]
        public string Remark { get; set; }
    }
}
